<?php

namespace App\HttpController;

use App\Service\SensitiveService;
use App\Service\StaffService;
use App\Utility\Verification;
use EasySwoole\HttpAnnotation\AnnotationTag\Api;
use EasySwoole\HttpAnnotation\AnnotationTag\ApiDescription;
use EasySwoole\HttpAnnotation\AnnotationTag\ApiGroup;
use EasySwoole\HttpAnnotation\AnnotationTag\ApiSuccess;
use EasySwoole\HttpAnnotation\AnnotationTag\Method;
use EasySwoole\HttpAnnotation\AnnotationTag\Param;
use EasySwoole\Mysqli\Exception\Exception;
use Throwable;

/**
 * @ApiGroup(groupName="员工管理端")
 */
class Staff extends StaffController
{
    /**
     * @Api(name="员工账号登录", path="/staff/login", version="1.0.0")
     * @ApiDescription(value="员工账号登录")
     * @Method(allow={POST})
     * @Param(name="username", description="账号或手机号", required="", notEmpty="", from={JSON})
     * @Param(name="password", description="登录密码", required="", notEmpty="", from={JSON})
     * @ApiSuccess({"code": 200,"result": {"id": 1,"phone": "13131313131","email": "","username": "admin","nickname": "超级管理员","name": "王某","post": "web开发","depart": "网络工程","job_no": "001","company": "蓝海文化","avatar": "","address": "","type": 1,"login_time": 1654055610,"login_ip": "127.0.0.1","is_deleted": 0,"create_time": 0,"update_time": 1654055610,"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NTQ2NjA2MTcsInN1YiI6IklNIiwibmJmIjoxNjU0MDU1ODA3LCJhdWQiOiJhZG1pbiIsImlhdCI6MTY1NDA1NTgxNywianRpIjoiOTcxZWQ0YTBhM2U2ZDNiMDYyNzVmYzY0ZWRkMDkxMTMiLCJpc3MiOiJhZG1pbiIsInN0YXR1cyI6MSwiZGF0YSI6eyJ1aWQiOjEsInVzZXJJZCI6MTMxMzEzMTMxMzEsInVzZXJuYW1lIjoiYWRtaW4iLCJ0eXBlIjoxLCJkYXRhIjpbXX19.xefb1fQ1G_mB4fWZf4oAlNeu6cNJOZhwKtnsB_R6ZmU"},"msg": "登陆成功"})
     * @return bool
     * @throws Exception
     * @throws \EasySwoole\ORM\Exception\Exception
     * @throws Throwable
     */
    public function login($username, $password): bool
    {
        $ips = $this->request()->getHeaders()['x-real-ip'] ?? [];
        $this->ip = $ips[0] ?? '127.0.0.1';
        $res = StaffService::getInstance()->staffLogin($username, $password, $this->ip);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="首页导航获取", path="/staff/getNav", version="1.0.0")
     * @ApiDescription(value="首页导航获取")
     * @Method(allow={POST})
     * @ApiSuccess({"code": 200,"result": {"name": "超级管理员","desc": "超级管理员","nav": [{"id": 1,"method": "notice","name": "消息中心","icon": "","image": "","desc": "消息中心"},{"id": 2,"method": "repair","name": "报事报修","icon": "","image": "","desc": "报事报修"},{"id": 3,"method": "work","name": "我的工单","icon": "","image": "","desc": "我的工单"},{"id": 4,"method": "patrol","name": "巡查管理","icon": "","image": "","desc": "巡查管理"},{"id": 5,"method": "share","name": "邻里共享","icon": "","image": "","desc": "邻里共享"},{"id": 6,"name": "门岗管理","icon": "","image": "","desc": "门岗管理"},{"id": 7,"method": "park","name": "车场管理","icon": "","image": "","desc": "车场管理"},{"id": 8,"method": "active","name": "活动核销","icon": "","image": "","desc": "活动核销"},{"id": 9,"method": "collection","name": "物业费催收","icon": "","image": "","desc": "物业费催收"}]},"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getNav(): bool
    {
        $res = StaffService::getInstance()->getStaffNav($this->sid, $this->type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="重置密码", path="/staff/changePass", version="1.0.0")
     * @ApiDescription(value="重置密码")
     * @Method(allow={POST})
     * @Param(name="password", required="", notEmpty="密码不能为空", description="原始密码", from={JSON})
     * @Param(name="new_password", required="", notEmpty="新密码不能为空", description="新密码", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function changePass($password, $new_password): bool
    {
        $res = StaffService::getInstance()->changePass($this->sid, $password, $new_password);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取访客列表", path="/staff/getVisit", version="1.0.0")
     * @ApiDescription(value="获取访客列表")
     * @Method(allow={POST})
     * @Param(name="status", defaultValue="99", description="状态：0.待处理，1.已处理，-1.未处理", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 6,"uid": 1,"house": "龍舟壹号院1号楼1单元101室","time": "2022-05-12 11:54","name": "ewrerwt ew","tel": "131****2121","person": 5,"is_car": 1,"car": "吉A23456","status": 0,"status_label": "待处理"}],"msg": "获取成功"})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getVisit($status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getVisit($status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取访客详情", path="/staff/getVisitDetail", version="1.0.0")
     * @ApiDescription(value="获取访客详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", from={JSON})
     * @ApiSuccess({"code": 200,"result": {"id": 1,"uid": 1,"house": "龍舟壹号院1号楼1单元101室","time": "2022-04-11 11:13","name": "委屈","tel": "12121212121","person": 2,"is_car": 1,"car": "甘A12345","status": 1,"status_label": "已处理","create_time": "2022-04-11 11:14:12","u_name": "在找着","u_tel": "17693113734"},"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getVisitDetail($id): bool
    {
        $res = StaffService::getInstance()->getVisitDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索访客", path="/staff/searchVisit", version="1.0.0")
     * @ApiDescription(value="搜索访客")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索关键字", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 3,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 11:53","name": "fsd","tel": "131****2121","person": 3,"is_car": 0,"car": "","status": 1,"status_label": "已处理"}],"msg": "获取成功"})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchVisit($keyword): bool
    {
        $res = StaffService::getInstance()->searchVisit($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="访客审核信息", path="/staff/examineVisit", version="1.0.0")
     * @ApiDescription(value="访客审核信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @Param(name="memo", description="审核备注", required="", notEmpty="审核备注不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examineVisit($id, $status, $memo): bool
    {
        $res = StaffService::getInstance()->examineVisit($this->sid, $id, $status, $memo);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyVisit", version="1.0.0")
     * @ApiDescription(value="查询我的工单（门岗位，查询访客）")
     * @Method(allow={POST})
     * @Param(name="start", description="起始时间", required="", notEmpty="起始时间不能为空", from={JSON})
     * @Param(name="end", description="结束时间", required="", notEmpty="结束时间不能为空", from={JSON})
     * @Param(name="status", description="状态", defaultValue="99", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 3,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 11:53","name": "fsd","tel": "131****2121","person": 3,"is_car": 0,"car": "","status": 1,"status_label": "已处理"}],"msg": "获取成功"})* @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyVisit($start, $end, $status): bool
    {
        $res = StaffService::getInstance()->getMyVisit($this->sid, $start, $end, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取报修列表", path="/staff/getRepair", version="1.0.0")
     * @ApiDescription(value="获取报修列表")
     * @Method(allow={POST})
     * @Param(name="status", defaultValue="99", description="状态：0.待处理，1.已处理，2.处理中，-1.已关闭", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 3,"uid": 1,"house": "龍舟壹号院1号楼1单元101室","time": "2022-05-16 10:50","name": "单独的","tel": "13131331322","name1": "突突突","tel1": "12121212121","content": "Vvvbbbbbbb","images": ["https://admin.gslhzhwy.com/upload/70/d98d22ccaa5783da086fa9b3d88a83.jpg"],"type": "管道疏通","status": 0,"status_label": "待处理","code": 1652669445}],"msg": "获取成功"})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getRepair($status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getRepair($status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取报修详情", path="/staff/getRepairDetail", version="1.0.0")
     * @ApiDescription(value="获取报修详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", from={JSON})
     * @ApiSuccess({"code": 200,"result": {"id": 1,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 14:10","name": "dsaf","tel": "13122222222","name1": "fdsafs","tel1": "13131313131","content": "dsafsdfsa","images": [],"type": "管道疏通","status": 0,"status_label": "待处理","code": 1649657451,"examine": {"id": 1,"uid": 1,"sid": 1,"pid": 1,"engineer": "王XX","offer_image": null,"offer_memo": "","offer_price": "0.00","complete_image": null,"complete_memo": "","is_deleted": 0,"examine_time": "2022-06-09 16:32:27","examine_new_time": "2022-06-09 16:32:27"}},"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getRepairDetail($id): bool
    {
        $res = StaffService::getInstance()->getRepairDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索报修", path="/staff/searchRepair", version="1.0.0")
     * @ApiDescription(value="搜索报修")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索报修", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 1,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 14:10","name": "dsaf","tel": "13122222222","name1": "fdsafs","tel1": "13131313131","content": "dsafsdfsa","images": [],"type": "管道疏通","status": 0,"status_label": "待处理","code": 1649657451}],"msg": "获取成功"})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchRepair($keyword): bool
    {
        $res = StaffService::getInstance()->searchRepair($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修抢单", path="/staff/grabbingRepair", version="1.0.0")
     * @ApiDescription(value="报修抢单")
     * @Method(allow={POST})
     * @Param(name="id", description="报修事物id", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     */
    public function grabbingRepair($id): bool
    {
        $res = StaffService::getInstance()->grabbingRepair($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修报价", path="/staff/offerRepair", version="1.0.0")
     * @ApiDescription(value="报修报价")
     * @Method(allow={POST})
     * @Param(name="id", description="事物id", required="id必填", notEmpty="id不能为空", from={JSON})
     * @Param(name="image", description="图片集", required="图片集必填", notEmpty="图片集不能为空", from={JSON})
     * @Param(name="price", description="价格", required="价格必填", notEmpty="价格不能为空", from={JSON})
     * @Param(name="memo", description="备注", required="备注必填", notEmpty="备注不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function offerRepair($id, $image, $price, $memo): bool
    {
        $res = StaffService::getInstance()->offerRepair($this->sid, $id, $image, $price, $memo);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修完成", path="/staff/completeRepair", version="1.0.0")
     * @ApiDescription(value="报修完成")
     * @Method(allow={POST})
     * @Param(name="id", description="事物id", required="id必填", notEmpty="id不能为空", from={JSON})
     * @Param(name="image", description="图片集", required="图片集必填", notEmpty="图片集不能为空", from={JSON})
     * @Param(name="code", description="识别码", defaultValue="0", from={JSON})
     * @Param(name="memo", description="备注", required="备注必填", notEmpty="备注不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function completeRepair($id, $image, $code, $memo): bool
    {
        $res = StaffService::getInstance()->completeRepair($this->sid, $id, $image, $code, $memo);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修未完成说明", path="/staff/unCompleteRepair", version="1.0.0")
     * @ApiDescription(value="报修未完成说明")
     * @Method(allow={POST})
     * @Param(name="id", description="事物id", required="id必填", notEmpty="id不能为空", from={JSON})
     * @Param(name="un_complete_memo", description="未完成说明", from={JSON})
     * @Param(name="is_complete", description="当日是否完成：0.未完成，1.已完成", required="当日是否完成必填", notEmpty="当日是否完成不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function unCompleteRepair($id, $un_complete_memo, $is_complete): bool
    {
        $res = StaffService::getInstance()->unCompleteRepair($this->sid, $id, $un_complete_memo, $is_complete);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修类型搜索报修", path="/staff/searchTypeRepair", version="1.0.0")
     * @ApiDescription(value="报修类型搜索报修")
     * @Method(allow={POST})
     * @Param(name="type", description="报修类型", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 1,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 14:10","name": "dsaf","tel": "13122222222","name1": "fdsafs","tel1": "13131313131","content": "dsafsdfsa","images": [],"type": "管道疏通","status": 0,"status_label": "待处理","code": 1649657451}],"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchTypeRepair($type): bool
    {
        $res = StaffService::getInstance()->searchTypeRepair($type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyRepair", version="1.0.0")
     * @ApiDescription(value="查询我的工单（工程师位，查询报修）")
     * @Method(allow={POST})
     * @Param(name="start", description="起始时间", required="", notEmpty="起始时间不能为空", from={JSON})
     * @Param(name="end", description="结束时间", required="", notEmpty="结束时间不能为空", from={JSON})
     * @Param(name="status", description="状态", defaultValue="99", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 1,"uid": 1,"house": "龍舟壹号院1号楼1单元102室","time": "2022-04-11 14:10","name": "dsaf","tel": "13122222222","name1": "fdsafs","tel1": "13131313131","content": "dsafsdfsa","images": [],"type": "管道疏通","status": 0,"status_label": "待处理","code": 1649657451}],"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyRepair($start, $end, $status): bool
    {
        $res = StaffService::getInstance()->getMyRepair($this->sid, $start, $end, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取巡查首页统计数据", path="/staff/getPatrolStatic", version="1.0.0")
     * @ApiDescription(value="获取巡查首页统计数据")
     * @Method(allow={POST})
     * @ApiSuccess({"code": 200,"result": {"total": 1,"complete": 0,"incomplete": 1,"normal": 0,"abnormal": 0},"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getPatrolStatic(): bool
    {
        $res = StaffService::getInstance()->getPatrolStatic($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取今日巡查状况列表", path="/staff/getPatrolList", version="1.0.0")
     * @ApiDescription(value="获取今日巡查状况列表")
     * @Method(allow={POST})
     * @Param(name="complete", description="完成状态:99:全部，1.已完成，0.未完成", defaultValue="99", from={JSON})
     * @ApiSuccess({"code": 200,"result": [{"id": 1,"name": "照明灯","code": "VDu2wF118","address": "一号楼大厅","image": "http://zhwy.dev.com/upload/1f/9a7ce86d306f04287de029d7902437.jpeg","desc": "一号楼大厅","complete": 0}],"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getPatrolList($complete): bool
    {
        $res = StaffService::getInstance()->getPatrolList($this->sid, $complete);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取今日巡查状况状态列表", path="/staff/getPatrolStatusList", version="1.0.0")
     * @ApiDescription(value="获取今日巡查状况状态列表")
     * @Method(allow={POST})
     * @Param(name="status", description="完成状态:1.正常，-1.异常", required="状态必填", notEmpty="状态必填", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getPatrolStatusList($status): bool
    {
        $res = StaffService::getInstance()->getPatrolStatusList($this->sid, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取巡查设备详情", path="/staff/getPatrolDetail", version="1.0.0")
     * @ApiDescription(value="获取巡查设备详情")
     * @Method(allow={POST})
     * @Param(name="code", description="设备识别码", required="设备识别码必填", notEmpty="设备识别码必填", from={JSON})
     * @ApiSuccess({"code": 200,"result": {"id": 1,"name": "照明灯","code": "VDu2wF118","address": "一号楼大厅","image": "http://zhwy.dev.com/upload/1f/9a7ce86d306f04287de029d7902437.jpeg","desc": "一号楼大厅","complete": 0},"msg": "获取成功"})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getPatrolDetail($code): bool
    {
        $res = StaffService::getInstance()->getPatrolDetail($code);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="上报巡查设备状态", path="/staff/examinePatrol", version="1.0.0")
     * @ApiDescription(value="上报巡查设备状态")
     * @Method(allow={POST})
     * @Param(name="code", description="设备识别码", required="设备识别码必填", notEmpty="设备识别码必填", from={JSON})
     * @Param(name="memo", description="状态描述", from={JSON})
     * @Param(name="status", description="状态:1.正常，-1.异常", required="状态必填", notEmpty="状态必填", from={JSON})
     * @Param(name="image", description="图片集",  from={JSON})
     * @Param(name="content", description="检查项内容", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examinePatrol($code, $memo, $status, $image,$content): bool
    {
        $res = StaffService::getInstance()->examinePatrol($this->sid, $code, $memo, $status, $image,$content);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取四点半课堂列表", path="/staff/getAdjacentSchool", version="1.0.0")
     * @ApiDescription(value="获取四点半课堂列表")
     * @Method(allow={POST})
     * @Param(name="status", defaultValue="99", description="状态：0.待审核，1.进行中，2.待支付，-1.已关闭", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentSchool($status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getAdjacentSchool($status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取四点半课堂详情", path="/staff/getAdjacentSchoolDetail", version="1.0.0")
     * @ApiDescription(value="获取四点半课堂详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentSchoolDetail($id): bool
    {
        $res = StaffService::getInstance()->getAdjacentSchoolDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享四点半课堂审核信息", path="/staff/examineAdjacentSchool", version="1.0.0")
     * @ApiDescription(value="邻享四点半课堂审核信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @Param(name="memo", description="审核备注", required="", notEmpty="审核备注不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examineAdjacentSchool($id, $status, $memo): bool
    {
        $res = StaffService::getInstance()->examineAdjacentSchool($this->sid, $id, $status, $memo);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyAdjacentSchool", version="1.0.0")
     * @ApiDescription(value="查询我的工单（邻享四点半课堂）")
     * @Method(allow={POST})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyAdjacentSchool(): bool
    {
        $res = StaffService::getInstance()->getMyAdjacentSchool($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索邻享四点半课堂", path="/staff/searchAdjacentSchool", version="1.0.0")
     * @ApiDescription(value="搜索邻享四点半课堂")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索报修", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchAdjacentSchool($keyword): bool
    {
        $res = StaffService::getInstance()->searchAdjacentSchool($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享老人列表", path="/staff/getAdjacentOlder", version="1.0.0")
     * @ApiDescription(value="获取共享老人列表")
     * @Method(allow={POST})
     * @Param(name="status", defaultValue="99", description="状态：0.待审核，1.进行中，2.待支付，-1.已关闭", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentOlder($status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getAdjacentOlder($status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享老人详情", path="/staff/getAdjacentOlderDetail", version="1.0.0")
     * @ApiDescription(value="获取共享老人详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentOlderDetail($id): bool
    {
        $res = StaffService::getInstance()->getAdjacentOlderDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享共享老人审核信息", path="/staff/examineAdjacentOlder", version="1.0.0")
     * @ApiDescription(value="邻享共享老人审核信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @Param(name="memo", description="审核备注", required="", notEmpty="审核备注不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examineAdjacentOlder($id, $status, $memo): bool
    {
        $res = StaffService::getInstance()->examineAdjacentOlder($this->sid, $id, $status, $memo);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyAdjacentOlder", version="1.0.0")
     * @ApiDescription(value="查询我的工单（邻享共享老人）")
     * @Method(allow={POST})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyAdjacentOlder(): bool
    {
        $res = StaffService::getInstance()->getMyAdjacentOlder($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索邻享共享老人", path="/staff/searchAdjacentOlder", version="1.0.0")
     * @ApiDescription(value="搜索邻享共享老人")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索邻享共享老人", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchAdjacentOlder($keyword): bool
    {
        $res = StaffService::getInstance()->searchAdjacentOlder($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享工具列表", path="/staff/getAdjacentTools", version="1.0.0")
     * @ApiDescription(value="获取共享工具列表")
     * @Method(allow={POST})
     * @Param(name="status", description="状态：0.待审核，2.待使用,1.借用中，3.已归还，-1.已取消", defaultValue="0", from={JSON})
     * @Param(name="type", description="获取方式：0.物业配送，1.自提", defaultValue="0", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     */
    public function getAdjacentTools($type, $status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getAdjacentTools($type, $status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享共享工具审核信息", path="/staff/examineAdjacentTools", version="1.0.0")
     * @ApiDescription(value="邻享共享工具审核信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examineAdjacentTools($id, $status): bool
    {
        $res = StaffService::getInstance()->examineAdjacentTools($this->sid, $id, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享共享工具提取信息", path="/staff/expressAdjacentTools", version="1.0.0")
     * @ApiDescription(value="邻享共享工具提取信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="image", description="提取图片", required="", notEmpty="提取图片不能为空", from={JSON})
     * @Param(name="memo", description="提取备注", required="", notEmpty="提取备注不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function expressAdjacentTools($id, $image, $memo, $status): bool
    {
        $res = StaffService::getInstance()->expressAdjacentTools($this->sid, $id, $image, $memo, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索邻享共享工具", path="/staff/searchAdjacentTools", version="1.0.0")
     * @ApiDescription(value="搜索邻享共享工具")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索邻享共享工具", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchAdjacentTools($keyword): bool
    {
        $res = StaffService::getInstance()->searchAdjacentTools($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="归还共享工具", path="/staff/returnAdjacentTools", version="1.0.0")
     * @ApiDescription(value="归还共享工具")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function returnAdjacentTools($id): bool
    {
        $res = StaffService::getInstance()->returnAdjacentTools($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享工具详情", path="/staff/getAdjacentToolsDetail", version="1.0.0")
     * @ApiDescription(value="获取共享工具详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentToolsDetail($id): bool
    {
        $res = StaffService::getInstance()->getAdjacentToolsDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享厨房列表", path="/staff/getAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="获取共享厨房列表")
     * @Method(allow={POST})
     * @Param(name="status", description="状态：0.待审核，2.待使用,1.借用中，3.已归还，-1.已取消", defaultValue="0", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     */
    public function getAdjacentKitchen($status, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getAdjacentKitchen($status, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享共享厨房审核信息", path="/staff/examineAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="邻享共享厨房审核信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function examineAdjacentKitchen($id, $status): bool
    {
        $res = StaffService::getInstance()->examineAdjacentKitchen($this->sid, $id, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="邻享共享厨房提取信息", path="/staff/expressAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="邻享共享厨房提取信息")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @Param(name="image", description="提取图片", required="", notEmpty="提取图片不能为空", from={JSON})
     * @Param(name="memo", description="提取备注", required="", notEmpty="提取备注不能为空", from={JSON})
     * @Param(name="status", description="审核状态:1.同意，-1.拒绝", required="", notEmpty="审核状态不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function expressAdjacentKitchen($id, $image, $memo, $status): bool
    {
        $res = StaffService::getInstance()->expressAdjacentKitchen($this->sid, $id, $image, $memo, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索邻享共享厨房", path="/staff/searchAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="搜索邻享共享厨房")
     * @Method(allow={POST})
     * @Param(name="keyword", description="搜索邻享共享厨房", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchAdjacentKitchen($keyword): bool
    {
        $res = StaffService::getInstance()->searchAdjacentKitchen($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="归还共享厨房", path="/staff/returnAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="归还共享厨房")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function returnAdjacentKitchen($id): bool
    {
        $res = StaffService::getInstance()->returnAdjacentKitchen($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取共享厨房详情", path="/staff/getAdjacentKitchenDetail", version="1.0.0")
     * @ApiDescription(value="获取共享厨房详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAdjacentKitchenDetail($id): bool
    {
        $res = StaffService::getInstance()->getAdjacentKitchenDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyAdjacentTools", version="1.0.0")
     * @ApiDescription(value="查询我的工单（邻享共享工具）")
     * @Method(allow={POST})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyAdjacentTools(): bool
    {
        $res = StaffService::getInstance()->getMyAdjacentTools($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询我的工单", path="/staff/getMyAdjacentKitchen", version="1.0.0")
     * @ApiDescription(value="查询我的工单（邻享共享厨房）")
     * @Method(allow={POST})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyAdjacentKitchen(): bool
    {
        $res = StaffService::getInstance()->getMyAdjacentKitchen($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取活动列表", path="/staff/getActiveList", version="1.0.0")
     * @ApiDescription(value="获取活动列表")
     * @Method(allow={POST})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getActiveList(): bool
    {
        $res = StaffService::getInstance()->getActiveList();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取活动详情", path="/staff/getActiveDetail", version="1.0.0")
     * @ApiDescription(value="获取活动详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", required="", notEmpty="id不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getActiveDetail($id): bool
    {
        $res = StaffService::getInstance()->getActiveDetail($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="活动核销", path="/staff/completeActive", version="1.0.0")
     * @ApiDescription(value="活动核销")
     * @Method(allow={POST})
     * @Param(name="id", description="事物id", required="id必填", notEmpty="id不能为空", from={JSON})
     * @Param(name="code", description="识别码", required="识别码必填", notEmpty="识别码不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function completeActive($id, $code): bool
    {
        $res = StaffService::getInstance()->completeActive($this->sid, $id, $code);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="发布公告", path="/staff/releaseNotice", version="1.0.0")
     * @ApiDescription(value="发布公告")
     * @Method(allow={POST})
     * @Param(name="type", description="类型", required="类型", notEmpty="类型不能为空", from={JSON})
     * @Param(name="title", description="标题", required="标题", notEmpty="标题不能为空", from={JSON})
     * @Param(name="content", description="内容", required="内容必填", notEmpty="内容不能为空", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function releaseNotice($type, $title, $content): bool
    {
        $res = StaffService::getInstance()->releaseNotice($this->sid, $type, $title, $content);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="发布/修改话题", path="/staff/releaseTopic", version="1.0.0")
     * @ApiDescription(value="发布/修改话题")
     * @Method(allow={POST})
     * @Param(name="gid", description="话题id", defaultValue="0", from={JSON})
     * @Param(name="name", description="标题", required="标题", notEmpty="标题不能为空", from={JSON})
     * @Param(name="description", description="内容", required="内容必填", notEmpty="内容不能为空", from={JSON})
     * @Param(name="icon", description="图标", required="图标必填", notEmpty="图标不能为空", from={JSON})
     * @Param(name="image", description="图片", required="图片必填", notEmpty="图片不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function releaseTopic($gid, $name, $icon, $image, $description): bool
    {
        $res = StaffService::getInstance()->releaseTopic($this->sid, $gid, $name, $icon, $image, $description);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="发布/修改活动", path="/staff/releaseActive", version="1.0.0")
     * @ApiDescription(value="发布/修改活动")
     * @Method(allow={POST})
     * @Param(name="nid", description="活动id", defaultValue="0", from={JSON})
     * @Param(name="type", description="类型：0.免费，1.收费", required="类型", notEmpty="类型不能为空", from={JSON})
     * @Param(name="is_hot", description="是否热门：0.否，1.是", required="是否热门", notEmpty="是否热门不能为空", from={JSON})
     * @Param(name="price", description="价格", required="价格必填", from={JSON})
     * @Param(name="content", description="内容", required="内容必填", notEmpty="内容不能为空", from={JSON})
     * @Param(name="image", description="图片", required="图片必填", notEmpty="图片不能为空", from={JSON})
     * @Param(name="title", description="标题", required="标题必填", notEmpty="标题不能为空", from={JSON})
     * @Param(name="sponsor", description="举办方", required="举办方必填", notEmpty="举办方不能为空", from={JSON})
     * @Param(name="matter", description="注意事项", required="注意事项必填", notEmpty="注意事项不能为空", from={JSON})
     * @Param(name="address", description="活动地址", required="活动地址必填", notEmpty="活动地址不能为空", from={JSON})
     * @Param(name="contact", description="联系人", required="联系人必填", notEmpty="联系人不能为空", from={JSON})
     * @Param(name="time", description="活动时间", required="活动时间必填", notEmpty="活动时间不能为空", from={JSON})
     * @Param(name="end_time", description="截止时间", required="截止时间必填", notEmpty="截止时间不能为空", from={JSON})
     * @Param(name="person", description="限制人数", required="限制人数必填", notEmpty="限制人数不能为空", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function releaseActive($nid, $type, $is_hot, $price, $content, $image, $title, $sponsor, $matter, $address, $contact, $time, $end_time, $person): bool
    {
        $res = StaffService::getInstance()->releaseActive($this->sid, $nid, $type, $is_hot, $price, $content, $image, $title, $sponsor, $matter, $address, $contact, $time, $end_time, $person);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取员工列表", path="/staff/getStaffList", version="1.0.0")
     * @ApiDescription(value="获取员工列表")
     * @Method(allow={POST})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getStaffList(): bool
    {
        $res = StaffService::getInstance()->getStaffList();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取我的工单待办事项数目", path="/staff/getBadge", version="1.0.0")
     * @ApiDescription(value="获取我的工单待办事项数目")
     * @Method(allow={POST})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getBadge(): bool
    {
        $res = StaffService::getInstance()->getBadge($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取用户反馈列表", path="/staff/getReport", version="1.0.0")
     * @ApiDescription(value="获取用户反馈列表")
     * @Method(allow={POST})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getReport(): bool
    {
        $res = StaffService::getInstance()->getReport();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取用户待审核房屋列表", path="/staff/getUserHouse", version="1.0.0")
     * @ApiDescription(value="获取用户待审核房屋列表")
     * @Method(allow={POST})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getUserHouse(): bool
    {
        $res = StaffService::getInstance()->getUserHouse($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取用户待审核车辆列表", path="/staff/getUserCar", version="1.0.0")
     * @ApiDescription(value="获取用户待审核车辆列表")
     * @Method(allow={POST})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getUserCar(): bool
    {
        $res = StaffService::getInstance()->getUserCar($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    public function getUserFamily(): bool
    {
        $res = StaffService::getInstance()->getUserFamily($this->sid);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索员工", path="/staff/searchStaff", version="1.0.0")
     * @ApiDescription(value="搜索员工")
     * @Method(allow={POST})
     * @Param(name="keyword", description="关键字", required="关键字必填", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchStaff($keyword): bool
    {
        $res = StaffService::getInstance()->searchStaff($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="提交工作日志", path="/staff/editLog", version="1.0.0")
     * @ApiDescription(value="提交工作日志")
     * @Method(allow={POST})
     * @Param(name="complete", description="今日完成内容", required="今日完成内容必填", notEmpty="今日完成内容不能为空", from={JSON})
     * @Param(name="un_complete", description="今日未完成内容", required="今日未完成内容必填", notEmpty="今日未完成内容不能为空", from={JSON})
     * @Param(name="problem", description="今日存在问题", required="今日存在问题必填", notEmpty="今日存在问题不能为空", from={JSON})
     * @Param(name="plan", description="明日计划内容", required="明日计划内容必填", notEmpty="明日计划内容不能为空", from={JSON})
     * @Param(name="info", description="市场信息内容", required="市场信息内容必填", notEmpty="市场信息内容不能为空", from={JSON})
     * @Param(name="report", description="意见及建议内容", required="意见及建议内容必填", notEmpty="意见及建议内容不能为空", from={JSON})
     * @Param(name="images", description="上传图片", from={JSON})
     * @Param(name="file", description="上传附件", from={JSON})
     * @Param(name="id", description="id", defaultValue="0", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function editLog($complete, $un_complete, $problem, $plan, $info, $report, $images, $file, $id): bool
    {
        $res = StaffService::getInstance()->editLog($this->sid, $complete, $un_complete, $problem, $plan, $info, $report, $images, $file, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询工作日志列表", path="/staff/selectLog", version="1.0.0")
     * @ApiDescription(value="查询工作日志列表")
     * @Method(allow={POST})
     * @Param(name="start", description="开始时间", from={JSON})
     * @Param(name="end", description="结束时间", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function selectLog($start, $end): bool
    {
        $res = StaffService::getInstance()->selectLog($this->sid, $start, $end);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="查询工作日志详情", path="/staff/getLogDetail", version="1.0.0")
     * @ApiDescription(value="查询工作日志详情")
     * @Method(allow={POST})
     * @Param(name="id", description="id", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getLogDetail($id): bool
    {
        $res = StaffService::getInstance()->getLogDetail($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @ApiDescription(value="发布格子铺")
     * @Api(name="发布格子铺", path="/staff/createLattice", version="1.0.0")
     * @Method(allow={POST})
     * @Param(name="topic", defaultValue="0", description="话题id", from={JSON})
     * @Param(name="content", description="文字心情", required="", from={JSON})
     * @Param(name="images", description="图片", required="", from={JSON})
     * @Param(name="price", description="价格", required="", from={JSON})
     * @return bool
     * @throws \EasySwoole\ORM\Exception\Exception
     * @throws Throwable
     */
    public function createLattice($topic, $content, $images, $price): bool
    {
        $res = StaffService::getInstance()->createLattice($this->sid, $topic, $content, $images, $price);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取格子铺列表", path="/staff/getLatticeList", version="1.0.0")
     * @ApiDescription(value="获取格子铺列表")
     * @Method(allow={POST})
     * @Param(name="tid", defaultValue=99, description="话题", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getLatticeList($tid, $limit, $page): bool
    {
        $res = StaffService::getInstance()->getLatticeList($tid, $limit, $page);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取格子铺产品详情", path="/staff/getLatticeDetail", version="1.0.0")
     * @ApiDescription(value="获取格子铺产品详情")
     * @Method(allow={POST})
     * @Param(name="id", required="", notEmpty="", description="产品id", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getLatticeDetail($id): bool
    {
        $res = StaffService::getInstance()->getLatticeDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取格子铺订单列表", path="/staff/getLatticeOrder", version="1.0.0")
     * @ApiDescription(value="获取格子铺订单列表")
     * @Method(allow={POST})
     * @Param(name="status", defaultValue="99", description="状态", from={JSON})
     * @Param(name="limit", defaultValue=10, description="单页数量", from={JSON})
     * @Param(name="page", defaultValue=1, description="页数", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getLatticeOrder($limit, $page, $status): bool
    {
        $res = StaffService::getInstance()->getLatticeOrder($limit, $page, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取格子铺订单详情", path="/staff/getLatticeOrderDetail", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取格子铺订单详情")
     * @Param(name="id", description="订单id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getLatticeOrderDetail($id): bool
    {
        $res = StaffService::getInstance()->getLatticeOrderDetail($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索格子铺产品", path="/staff/searchLatticeGoods", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="搜索格子铺产品")
     * @Param(name="keyword", description="关键字，产品名称", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchLatticeGoods($keyword): bool
    {
        $res = StaffService::getInstance()->searchLatticeGoods($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="搜索格子铺订单", path="/staff/searchLatticeOrder", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="搜索格子铺订单")
     * @Param(name="keyword", description="关键字，联系人或联系电话", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function searchLatticeOrder($keyword): bool
    {
        $res = StaffService::getInstance()->searchLatticeOrder($keyword);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="格子铺产品下架", path="/staff/offShell", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="格子铺产品下架")
     * @Param(name="id", description="产品id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function offShell($id): bool
    {
        $res = StaffService::getInstance()->offShell($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="格子铺产品发货", path="/staff/latticeSend", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="格子铺产品发货")
     * @Param(name="id", description="订单id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function latticeSend($id): bool
    {
        $res = StaffService::getInstance()->latticeSend($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="格子铺产品完成", path="/staff/latticeComplete", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="格子铺产品完成")
     * @Param(name="id", description="订单id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function latticeComplete($id): bool
    {
        $res = StaffService::getInstance()->latticeComplete($id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产列表", path="/staff/getAssets", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取固定资产列表")
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssets(): bool
    {
        $res = StaffService::getInstance()->getAssets();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产分类列表", path="/staff/getAssetsType", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取固定资产分类列表")
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsType(): bool
    {
        $res = StaffService::getInstance()->getAssetsType();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="采购固定资产", path="/staff/purchase", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="采购固定资产")
     * @Param(name="nid", description="分类id", required="", notEmpty="", from={JSON})
     * @Param(name="name", description="名称", required="", notEmpty="", from={JSON})
     * @Param(name="price", description="总价", required="", notEmpty="", from={JSON})
     * @Param(name="unit", description="单价", required="", notEmpty="", from={JSON})
     * @Param(name="num", description="数量", required="", notEmpty="", from={JSON})
     * @Param(name="label", description="介绍", required="", notEmpty="", from={JSON})
     * @Param(name="time", description="时间", required="", notEmpty="", from={JSON})
     * @Param(name="image", description="图片", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function purchase($nid, $name, $price, $unit, $num, $label, $time, $image): bool
    {
        $res = StaffService::getInstance()->assetsIn($this->sid, $nid, $name, $price, $unit, $num, $label, $time, $image, 0);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="领取固定资产", path="/staff/receive", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="领取固定资产")
     * @Param(name="gid", description="资产id", required="", notEmpty="", from={JSON})
     * @Param(name="num", description="数量", required="", notEmpty="", from={JSON})
     * @Param(name="time", description="时间", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function receive($gid, $num, $time): bool
    {
        $res = StaffService::getInstance()->assetsOut($this->sid, $gid, $num, $time, 1);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="借用固定资产", path="/staff/borrow", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="借用固定资产")
     * @Param(name="gid", description="资产id", required="", notEmpty="", from={JSON})
     * @Param(name="num", description="数量", required="", notEmpty="", from={JSON})
     * @Param(name="time", description="时间", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function borrow($gid, $num, $time): bool
    {
        $res = StaffService::getInstance()->assetsOut($this->sid, $gid, $num, $time, 2);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产待审核列表", path="/staff/getAssetsLogList", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="借用固定资产")
     * @Param(name="type", description="类型", defaultValue="99", from={JSON})
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsLogList($type): bool
    {
        $res = StaffService::getInstance()->getAssetsLogList($type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="审核固定资产记录", path="/staff/assetsExamine", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="审核固定资产记录")
     * @Param(name="id", description="记录id", required="", notEmpty="", from={JSON})
     * @Param(name="status", description="审核状态：1成功，-1失败", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function assetsExamine($id, $status): bool
    {
        $res = StaffService::getInstance()->assetsExamine($this->sid, $id, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产数据", path="/staff/getAssetsData", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取固定资产数据")
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsData(): bool
    {
        $res = StaffService::getInstance()->getAssetsData();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产数据统计", path="/staff/getAssetsStatic", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取固定资产数据统计")
     * @return bool
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsStatic(): bool
    {
        $res = StaffService::getInstance()->getAssetsStatic();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取固定资产进出库列表", path="/staff/getAssetsInOutLog", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取固定资产进出库列表")
     * @Param(name="type", description="类型", defaultValue="99", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsInOutLog($type): bool
    {
        $res = StaffService::getInstance()->getAssetsInOutLog($type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="获取我的固定资产进出库列表", path="/staff/getMyAssetsInOutLog", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="获取我的固定资产进出库列表")
     * @Param(name="type", description="类型：0.采购，1.领取，2.借还", defaultValue="99", from={JSON})
     * @Param(name="status", description="状态0.待审核，1.审核成功，-1.拒绝", defaultValue="99", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getMyAssetsInOutLog($type, $status): bool
    {
        $res = StaffService::getInstance()->getMyAssetsInOutLog($this->sid, $type, $status);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     *
     * @Api(name="归还固定资产", path="/staff/revert", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="归还固定资产")
     * @Param(name="id", description="申请借用id", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function revert($id): bool
    {
        $res = StaffService::getInstance()->assetsRevert($this->sid, $id);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="出入库报表", path="/staff/getAssetsReport", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="出入库报表")
     * @Param(name="type", description="类型0.出库，1.入库", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function getAssetsReport($type): bool
    {
        $res = StaffService::getInstance()->getAssetsReport($type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="出入库审批", path="/staff/approve", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="出入库审批")
     * @Param(name="id", description="记录id", required="", notEmpty="", from={JSON})
     * @Param(name="is_examine", description="审核状态-1.拒绝，1.成功", required="", notEmpty="", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function approve($id,$is_examine): bool
    {
        $res = StaffService::getInstance()->approve($this->sid, $id, $is_examine);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="仓库统计", path="/staff/storehouseStatic", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="仓库统计")
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function storehouseStatic(): bool
    {
        $res = StaffService::getInstance()->storehouseStatic();
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }

    /**
     * @Api(name="报修", path="/staff/repair", version="1.0.0")
     * @Method(allow={POST})
     * @ApiDescription(value="报修")
     * @Param(name="house", description="房屋", from={JSON})
     * @Param(name="type", description="类型", from={JSON})
     * @Param(name="content", description="维修内容", required="维修内容必填", from={JSON})
     * @Param(name="images", description="上传图片", from={JSON})
     * @return bool
     * @throws Exception
     * @throws Throwable
     * @throws \EasySwoole\ORM\Exception\Exception
     */
    public function repair($content,$images,$type): bool
    {
        $res = StaffService::getInstance()->repair($this->sid, $content,$images,$type);
        if (!$res['result']) {
            return $this->writeJsonError($res['msg']);
        }
        return $this->writeJsonSuccess($res['data'], $res['msg']);
    }
}